<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用户列表页</title>
<link rel="stylesheet"
	href="/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
<script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript"
	src="/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</head>
<body style="background-color: #F5F5FA">
	
	<#include "/back/navigation.html">
	
	<div class="main">
		
		<div class="main-content">
			<div class="container-fluid">
				<h3>用户管理</h3>
				<div class="row">
					<div class="col-md-12 column">
						<form class="navbar-form navbar-left" action="/back/userinfo/list?page=1" method="post" class="form-control">
							<div class="input-group">
								<input type="text" placeholder="请输入查询的姓名..." name="name">
								<span><input type="text" name="username" placeholder="请输入查询的账号..."/></span>
								<span class="input-group-btn"><button type="button" class="btn btn-primary">Go</button></span>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		
	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<form action="/back/userinfo/list?page=1" method="post" class="form-inline">
					<div class="row alert alert-info" style="margin: 1px; padding: 0px">
						<input type="hidden" name="page" value="1" /> 
						<input type="text" name="name" placeholder="请输入查询的姓名" style="width: 170px"/> 
						<input type="text" name="username" placeholder="请输入查询的账号" style="width: 170px"/> 
						<input type="submit" class="btn btn-danger" value="查询" /> 
						<a href="/back/userinfo/loadAddUser" class="btn btn-warning">新增用户</a>
						<!-- Button trigger modal -->
						<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addusers">批量添加用户</button>
						<a href="/back/userinfo/exportUsers?username=${(userinfo.username)!}&name=${(userinfo.name)!}" class="btn btn-info">导出查询结果</a>
					</div>
				</form>


				<!-- 批量添加用户的模态框 -->
				<form action="/back/userinfo/importUsers" method="post"
					enctype="multipart/form-data">
					<div class="modal fade" id="addusers" tabindex="-1" role="dialog"
						aria-labelledby="myModalLabel">
						<div class="modal-dialog" role="document">
							<div class="modal-content">
								<div class="modal-header">
									<button type="button" class="close" data-dismiss="modal"
										aria-label="Close">
										<span aria-hidden="true">&times;</span>
									</button>
									<h4 class="modal-title" id="myModalLabel">请选择Excel文件</h4>
								</div>
								<div class="modal-body">
									<input type="file" name="users" class="form-control" />
								</div>
								<div class="modal-footer">
									<button type="button" class="btn btn-default"
										data-dismiss="modal">取消</button>
									<button type="submit" class="btn btn-primary">上传</button>
								</div>
							</div>
						</div>
					</div>
				</form>

			</div>
		</div>
	</div>

	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<div class="row alert alert-info" style="margin: 4px; padding: 5px">
					<table class="table table-hover table-striped">
						<thead>
							<tr class="info">
								<th>用户编号</th>
								<th>用户名</th>
								<th>密码</th>
								<th>姓名</th>
								<th>性别</th>
								<th>手机号</th>
								<th>用户类型</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							<#list (pageBean.list)! as u>
							<tr class="info">
								<td>${(u.userId)!}</td>
								<td>${(u.username)!}</td>
								<td>${(u.password)!}</td>
								<td>${(u.name)!}</td>
								<td>${(u.sex)!}</td>
								<td>${(u.mobilephone)!}</td>
								<td>${(u.usertype)!}</td>
								<td><a href="/back/userinfo/loadUpdateUserInfo?userId=${(u.userId)!}" class="btn btn-info">修改</a> <a href="javascript:void(0)" onclick="del(${(u.userId)!})" class="btn btn-danger">删除</a></td>
							</tr>
							</#list>
						</tbody>
					</table>
					<ul class="pagination">
						<#if pageBean.currentPage==1> <#else>
						<li><a
							href="/back/userinfo/list?page=1&username=${(userinfo.username)!}&name=${(userinfo.name)!}">第一页</a></li>
						<li><a
							href="/back/userinfo/list?page=${pageBean.currentPage -1}&username=${(userinfo.username)!}&name=${(userinfo.name)!}">上一页</a></li></#if>
						<li><a href="#">第${(pageBean.currentPage)!}页</a></li>
						<li><a href="#">共${(pageBean.totalPage)!}页</a></li>
						<li><a href="#">共${(pageBean.allRow)!}条数据</a></li>
						<#if pageBean.currentPage== pageBean.totalPage> <#else>
						<li><a
							href="/back/userinfo/list?page=${pageBean.currentPage +1}&username=${(userinfo.username)!}&name=${(userinfo.name)!}">下一页</a></li>
						<li><a
							href="/back/userinfo/list?page=${pageBean.totalPage}&username=${(userinfo.username)!}&name=${(userinfo.name)!}">最末页</a></li></#if>
					</ul>
				</div>
			</div>
		</div>
	</div>
	
	
	</div>
	
	
	
	<script type="text/javascript">
		function del(id) {
			if(confirm("确定删除该用户？")){
				window.location.href="/back/userinfo/deleteUserInfo?userId="+id;
			}
		}
	</script>
	
</body>
</html>